<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fun1(){				
				alert("即将跳转到百度！");
				window.location.href = "https://www.baidu.com";
			}
			function fun2(){
				if(confirm("是否跳转到百度！")){
					window.location.href = "https://www.baidu.com";
				}
				
			}
			function fun3(){
				var s=prompt("请输入网址：","https://www.baidu.com");
				window.location.href=s;
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="fun1()">跳转到百度</button>
		<button type="button" onclick="fun2()">是否跳转到百度</button>
		<button type="button" onclick="fun3()">自定义跳转</button>
	</body>
</html>
